package org.osiris.server.utils;


import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Repository;

/**
 * This class provides application-wide access to the Spring ApplicationContext.
 * The ApplicationContext is injected by the class "ApplicationContextProvider".
 *
 * @author Siegfried Bolz
 */

public class AppContext {
	
    private static ApplicationContext ctx;

    
    public static  boolean productionMode=false;
	
	public static  boolean cacheAfiliadosQuery=false;
	public static  boolean cacheClubesQuery=true;
	public static  boolean cacheCompeticionesQuery=true;
	public static  boolean cacheDesignacionesQuery=false;
	public static  boolean cacheEntidadesQuery=true;
	public static  boolean cacheEquiposQuery=true;
	public static  boolean cacheEstadiosQuery=true;
	public static  boolean cacheFederacionesQuery=true;
	public static  boolean cacheLicenciasQuery=true;
	
	
	public static  boolean cacheAfiliado=true;
	public static  boolean cacheClub=true;
	public static  boolean cacheCompeticion=true;
	public static  boolean cacheDesignacion=true;
	public static  boolean cacheEntidad=true;
	public static  boolean cacheEquipo=true;
	public static  boolean cacheEstadio=true;
	public static  boolean cacheFederacion=true;
	public static  boolean cacheLicencia=true;
	
    /**
     * Injected from the class "ApplicationContextProvider" which is automatically
     * loaded during Spring-Initialization.
     */
    public static void setApplicationContext(ApplicationContext applicationContext) {
        ctx = applicationContext;
    }

    /**
     * Get access to the Spring ApplicationContext from everywhere in your Application.
     *
     * @return
     */
    public static ApplicationContext getApplicationContext() {
        
    	return ctx;
    }
} // .EOF
